package gmusic.connexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class GestionConnexion {

	private static GestionConnexion instance;
	
	private String URL_JDBC = null;
	
	public static GestionConnexion getInstance() {
	
		if (instance == null)
			instance = new GestionConnexion();
		return instance;
	}

	private GestionConnexion() { }
	
	public void setURLJDBC(String URL) {
		URL_JDBC = URL;
	}
	
	public Connection getConnexion() throws SQLException {
	
		return algutil.connexion.GestionConnexion.getConnexionGMusic();
		//DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
		// Base MySQL EasyPHP sur Windows
		// return DriverManager.getConnection("jdbc:mysql://localhost/gmusic?user=root&password=");
        // Base MySQL MAMP sur MacLeGall
		//return DriverManager.getConnection("jdbc:mysql://localhost:8889/gmusic?user=root&password=root");
        // Base Oracle
		//DriverManager.registerDriver(new OracleDriver());
        //return DriverManager.getConnection("jdbc:oracle:thin:@ibm-alg:1521:XE", "gmusic", "ragnarok"); 
		//return DriverManager.getConnection(URL_JDBC);
	}
}